import React from "react"
import AuthStore from "./main/auth.Store"
import UserStore from "./main/user.Store"
import ChannelStore from "./main/channel.Store"
import TestStore from './main/test.Store'

class RootStore {
  constructor() {
    // 初始化子模块
    this.authStore = new AuthStore()
    this.userStore = new UserStore()
    this.channelStore = new ChannelStore()
    this.testStore = new TestStore()
  }
}

const rootStore = new RootStore()

const context = React.createContext(rootStore)

export const useStore = () => React.useContext(context)
